import { createApp } from 'vue'
import App from '@/App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import router from './router'
import pinia from './store'
import '@/styles/index.scss'
import 'virtual:svg-icons-register'
//暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
//引入路由鉴权文件
import './permission'
import SvgIcon from '@/components/SvgIcon/index.vue'

const app = createApp(App)
app.component('svg-icon', SvgIcon)
app.use(ElementPlus, {
  locale: zhCn,
})
// import 'virtual:svg-icons-register'
//引入自定义插件：注册整个项目对象插件
import globalComponents from '@/components/index'
//安装自定义插件
app.use(globalComponents)

// import axios from 'axios';
// axios({
//     url: '/api/user/login',
//     method: "post",
//     data: {
//         username: 'admin',
//         password: '112111'
//     }
// })
app.use(pinia)
//引入模板的全局样式
app.use(router)

console.log(import.meta.env)
//引入自定义指令文件
import { isHasButton } from './directive/has'
isHasButton(app)
app.mount('#app')
